package com.eugenema.entity;

import java.util.LinkedHashSet;
import java.util.Objects;

/**
 * 步骤
 * <br/>包含许多动作（step 元素），将这些动作看做一个整体去执行
 *
 * @author Eugenema
 * @date 2023/3/11 10:38
 *
 **/
public class TestCase extends TestBase{
	/** 动作列表 */
	private LinkedHashSet<TestStep> steps;

	public LinkedHashSet<TestStep> getStepSet() {
		return steps;
	}

	public void setStepSet(LinkedHashSet<TestStep> steps) {
		this.steps = steps;
	}

	@Override
	public String toString() {
		return String.format("TestCase【id：%s】：%s", getId(), getDesc());
	}

	/**
	 * id 一致则认定为相同
	 *
	 * @author Eugenema
	 * @date 2023/3/9 21:58
	 *
	 **/
	@Override
	public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (o == null || getClass() != o.getClass()) {
			return false;
		}
		TestCase testCase = (TestCase) o;
		return getId() == testCase.getId();
	}

	@Override
	public int hashCode() {
		return Objects.hash(getId());
	}
}
